package com.rocky.ssm.service;

import com.rocky.ssm.mapper.ScoreMapper;
import com.rocky.ssm.model.Score;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/8/15.
 */

@Service
public class ScoreService implements IScore{

    @Autowired
    private ScoreMapper scoreMapper;

    @Override
    public Score getScoreById(int id) {
        return scoreMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Score> getScoreList() {
        return scoreMapper.selectScoreList();
    }

    @Override
    public int save(Score score) {
        return scoreMapper.insert(score);
    }

    @Override
    public int update(Score score) {
        return scoreMapper.updateByPrimaryKey(score);
    }

    @Override
    public int delete(int id) {
        return scoreMapper.deleteByPrimaryKey(id);
    }
}
